package com.liu.mysqldemo.service.impl;

import com.github.pagehelper.PageHelper;
import com.liu.mysqldemo.dao.CosumersMapper;
import com.liu.mysqldemo.entity.Cosumers;
import com.liu.mysqldemo.service.CosumersService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CosumersServiceImpl implements CosumersService {

    @Resource
    private CosumersMapper cosumersMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return cosumersMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Cosumers record) {
        return cosumersMapper.insert(record);
    }

    @Override
    public int insertSelective(Cosumers record) {
        return cosumersMapper.insertSelective(record);
    }

    @Override
    public Cosumers selectByPrimaryKey(Integer id) {
        return cosumersMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Cosumers record) {
        return cosumersMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Cosumers record) {
        return cosumersMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Cosumers> findAllpersonBypage(Integer pageIndex, Integer pageSize) {
        PageHelper.startPage(pageIndex,pageSize);
        List<Cosumers> personList = cosumersMapper.findAllpersonBypage();
        return personList;
    }
}
